#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   user.py
@Time    :   2020/09/21 12:07:37
@Author  :   fengzhilaoling 
@Version :   1.0
@Contact :   fengzhilaoling@163.com
'''
from flask import Blueprint
from flask import render_template
from flask import request
from flask import render_template_string


user_bp = Blueprint('user', __name__)


@user_bp.route('/login/', methods=['GET', 'POST'])
def login():
    if request.method == 'GET':
        return render_template('user/login.html')
    elif request.method == 'POST':
        print('aa')
        user_name = request.form.get('userName')
        print(user_name)
        if user_name=='fengling':
            return render_template('user/index.html')
        else:
            return render_template_string('用户名错误')
    